package com.study.demoservice.controller;

import com.study.demoservice.service.RabbitMQService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/mall/rabbitmq")
public class RabbitMQController {

    @Resource
    private RabbitMQService rabbitMQService;

    /**
     * 发送消息
     * @return
     */
    @PostMapping("sendMsg")
    public String sendMsg(@RequestParam("msg") String msg) {

        return rabbitMQService.sendMsg(msg);
    }

}
